﻿using System.Collections.Generic;
using AutoMapper;
using FluentValidation.Results;
using Turquoise.Validation.Abstract;
using Turquoise.Validation.Entities;

namespace Turquoise.Validation.FluentValidation
{
    public abstract class BaseValidator : ITurquoiseValidator
    {
        public abstract bool IsValid { get; set; }
        protected readonly List<TurquoiseValidationResult> ValidationResults;

        protected BaseValidator()
        {
            var mapperConfiguration = new MapperConfiguration(cfg => cfg.CreateMap<ValidationFailure, TurquoiseValidationResult>());
            mapperConfiguration.CreateMapper();
            ValidationResults = new List<TurquoiseValidationResult>();

        }
        public abstract List<TurquoiseValidationResult> Validate();
    }
}
